package net.chenlin.dp.modules.business.dao;

import net.chenlin.dp.common.entity.Page;
import net.chenlin.dp.common.entity.Query;
import net.chenlin.dp.modules.business.entity.dto.deviceCalibration.CheckParam;
import net.chenlin.dp.modules.business.entity.po.DeviceCalibrationDataPo;
import net.chenlin.dp.modules.business.entity.po.deviceCalibration.DeviceCalibrationCheckPo;
import net.chenlin.dp.modules.business.entity.po.deviceCalibration.DeviceCalibrationDetailPo;
import net.chenlin.dp.modules.business.entity.vo.deviceCalibration.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.List;
import java.util.Map;

@Mapper
public interface DeviceCalibrationMapper {

    void batchInsertByExcel(List<DeviceCalibrationDataPo> list);

    List<DeviceCalibrationListVo> getDeviceCalibrationList(@Param("page") Page<DeviceCalibrationListVo> page, @Param("query") Query query);

    void batchInsertDeviceCalibrationDetail(List<DeviceCalibrationDetailPo> insertList);

    List<DeviceCalibrationDetailVo> getDeviceCalibrationResult(@Param("params")  Map<String, Object> params);

    List<DeviceCalibrationCheckVo> getDeviceCalibrationCheckResult(@Param("page") Page<DeviceCalibrationCheckVo> page, @Param("query") Query query);

    List<String> getDeviceNo();

    void countDeviceMeteredElectricity(String deviceNo);

    List<String> getCheckDeviceNo();

    void countCheckDeviceMeteredElectricity(String deviceNo);

    void updateCheckTime(DeviceCalibrationCheckPo param);

    void batchInsertDeviceCalibrationCheck(List<DeviceCalibrationCheckPo> checkList);

    List<StepVo> getCalibrationStep();

    List<StepVo> getCheckStep();

    BigDecimal getStartCountPower(String time);

    BigDecimal  getEndCountPower(String endTime);

    CountRatioVo getDeviceCoubnt(@Param("deviceNo")  String deviceNo, @Param("startTime")  String startTime, @Param("endTime")  String endTime);

    List<DeviceCalibrationDetailVo> getDeviceNoAndTime();

    void batchUpdateDeviceCalibrationDetail(List<DeviceCalibrationDetailPo> list);

    List<DeviceCalibrationDetailVo> getDeviceCalibrationDetailList(@Param("page") Page<DeviceCalibrationDetailVo> page, @Param("query")  Query query);

    List<DeviceCalibrationDataPo> getAllDeviceCalibration();

    void deleteDeviceCalibrationDetailByNo(String deviceNo);

    Integer getDeviceCalibrationNum(String deviceNo);

    void deleteDeviceCalibration(String deviceNo);

    BigDecimal getCalibrationFactor(@Param("deviceNo") String deviceNo, @Param("phaseSequence") String phaseSequence);

    int updateCalibrationFactor(@Param("deviceNo") String deviceNo, @Param("phaseSequence") String phaseSequence, @Param("reDecimal") BigDecimal reDecimal);
}
